from django.urls import path
import systems.views.home as home
import systems.views.login as login
import systems.views.user_profile as user
import systems.views.dept as dept
import systems.views.menu as menu
import systems.views.role as role
import systems.views.permission as per
import systems.views.dictionary as dic
import systems.views.operation_log as log
import systems.views.crontab as cron


urlpatterns = [
    path('login/',                    login.LoginView.as_view(),        name='login'),
    path('logout/',                   login.LogoutView.as_view(),       name='logout'),
    path('clogin/',                   login.ClientLoginView.as_view(),  name='client_login'),
    path('cregist/',                  login.ClientRegistView.as_view(), name='client_regist'),
    path('alogin/',                   login.AppletLoginView.as_view(),  name='a_login'),
    path('aregist/',                  login.AppletRegistView.as_view(), name='a_regist'),
    path('wxlogin/',                  login.WeChatLoginView.as_view(),  name='wx_login'),
    path('user/pwdmodify/',           login.ModifyPwdView.as_view(),    name='user_pwd_modify'),
    path('user/pwdreset/<int:i_id>/', login.ResetPwdView.as_view(),     name='user_pwd_reset'),

    path('user/list/',              user.ListView.as_view(),   name='user_list'),
    path('user/add/',               user.AddView.as_view(),    name='user_add'),
    path('user/detail/',            user.DetailView.as_view(), name='user_detail'),
    path('user/modify/',            user.ModifyView.as_view(), name='user_modify'),
    path('user/delete/<int:i_id>/', user.DeleteView.as_view(), name='user_delete'),
    path('user/export/',            user.ExportView.as_view(), name='user_export'),

    path('dept/list/',              dept.ListView.as_view(),       name='dept_list'),
    path('dept/add/',               dept.AddView.as_view(),        name='dept_add'),
    path('dept/detail/',            dept.DetailView.as_view(),     name='dept_detail'),
    path('dept/modify/',            dept.ModifyView.as_view(),     name='dept_modify'),
    path('dept/delete/<int:i_id>/', dept.DeleteView.as_view(),     name='dept_delete'),
    path('dept/clist/',             dept.ClientListView.as_view(), name='dept_clist'),

    path('dic/list/',              dic.ListView.as_view(),   name='dic_list'),
    path('dic/add/',               dic.AddView.as_view(),    name='dic_add'),
    path('dic/detail/',            dic.DetailView.as_view(), name='dic_detail'),
    path('dic/modify/',            dic.ModifyView.as_view(), name='dic_modify'),
    path('dic/delete/<int:i_id>/', dic.DeleteView.as_view(), name='dic_delete'),

    path('menu/list/',              menu.ListView.as_view(),   name='menu_list'),
    path('menu/add/',               menu.AddView.as_view(),    name='menu_add'),
    path('menu/detail/',            menu.DetailView.as_view(), name='menu_detail'),
    path('menu/modify/',            menu.ModifyView.as_view(), name='menu_modify'),
    path('menu/delete/<int:i_id>/', menu.DeleteView.as_view(), name='menu_delete'),
    path('menu/icons/',             menu.IconsView.as_view(),  name='menu_icons'),

    path('role/list/',              role.ListView.as_view(),   name='role_list'),
    path('role/add/',               role.AddView.as_view(),    name='role_add'),
    path('role/detail/',            role.DetailView.as_view(), name='role_detail'),
    path('role/modify/',            role.ModifyView.as_view(), name='role_modify'),
    path('role/delete/<int:i_id>/', role.DeleteView.as_view(), name='role_delete'),

    path('per/list/',              per.ListView.as_view(),     name='per_list'),
    path('per/detail/',            per.DetailView.as_view(),   name='per_detail'),
    path('per/savedata/',          per.SaveDataView.as_view(), name='per_save_data'),
    path('per/savemenu/',          per.SaveMenuView.as_view(), name='per_save_menu'),

    path('log/list/', log.ListView.as_view(), name='log_list'),

    path('cron/list/', cron.ListView.as_view(), name='cro_list'),

    path('download/', home.download_update, name="download"),
]
